package com.hex.ds.hdrs.period.task.dto;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
public class PeriodTaskDefDto {

    //下游任务数
    private int downTaskAllNum;

    //下游任务总资源数
    private int downTaskAllRes;

    private String pkId;

    private String taskCode;

    private String taskName;

    private String taskDesc;

    private String jobCode;

    private String shellPath;

    private String extParam;

    private String isEndTask;

    private int allowErrCount;

    private String mutexJob;

    private String mutexTask;

    private String isOrder;

    private Integer resNum;

    private Integer priorityLevel;

    private String appCode;

    private String appointAgentCode;

    private String planExecDuration;

    private String overPlanDuration;

    private String errDifferDuration = "0";

    private String crtTs;

    private String upTs;

    private String taskRemark;

    private String dependJob;

    private String dependTask;

    private String dependJobName;

    private String dependTaskName;

    private List<String> dependJobCodeList;

    private List<String> dependTaskCodeList;

    private List<String> appCodeList;
    /**
     * 选中行的主键集合
     */
    private List<String> selectionList;
    /**
     * 日期范围
     */
    private String[] dateRange;

    private List<String> pkIds;

    private String type;

    private String blurry;

    private String isInit;

    private String groupCode;

    // 导入时操作
    private String operation;

    public String getDependJob() {
        if (CollectionUtil.isNotEmpty(dependJobCodeList)) {
            return StrUtil.join(",", dependJobCodeList);
        }
        return dependJob;
    }

    public String getDependTask() {
        if (CollectionUtil.isNotEmpty(dependTaskCodeList)) {
            return StrUtil.join(",", dependTaskCodeList);
        }
        return dependTask;
    }


}
